package com.moneytree.service.impl;

import java.util.List;

import com.moneytree.model.Repay;
import com.moneytree.service.RepayService;
import com.moneytree.utils.Page;
import com.moneytree.utils.PersistenceUtils;

public class RepayServiceImpl extends PersistenceUtils<Repay, String> implements RepayService {

	@Override
	public Repay queryById(String id) {
		return get(id);
	}

	@Override
	public void saveOrUpdate(Repay repay) {
		saveOrUpdate(repay);
	}

	@Override
	public void delete(Repay repay) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Repay queryRepay(Repay repay) {
		return query(repay);
	}

	@Override
	public Page queryBean(Repay repay, Page page) {
		int start = Page.countOffset(page.getPageSize(), page.getCurrentPage());
		int allCount = super.count(repay);
		List<Repay> list = super.queryList(repay, start, page.getPageSize());
		return Page.toPage(list, page.getCurrentPage(), page.getPageSize(), allCount);
	}

}
